import request from '@/utils/request'

const ROLE_BASE_URL = 'system-service/admin/system/sysRole'

export default{
    // 获取角色列表分页列表带搜索
    getPageRoleList(page,limit,searchObj){
        return request({
            url: `${ROLE_BASE_URL}/${page}/${limit}`,
            method: 'get',
            params: searchObj
        });
    },
    removeRoleById(id){
        return request({
            url: `${ROLE_BASE_URL}/remove/${id}`,
            method: 'delete'
        })
    },
    saveRole(sysRole){
        return request({
            url: `${ROLE_BASE_URL}/save`,
            method: 'post',
            data: sysRole
        })
    },
    getRoleInfoById(id){
        return request({
            url: `${ROLE_BASE_URL}/findRoleById/${id}`,
            method: 'post'
        })
    },
    updateRole(sysRole){
        return request({
            url: `${ROLE_BASE_URL}/update`,
            method: 'post',
            data: sysRole
        })
    },
    batchRemoveRole(ids){
        return request({
            url: `${ROLE_BASE_URL}/batchRemove`,
            method: 'post',
            data: ids
        })
    }
}